<?php
//admin后台
Route::Group(['prefix' => 'admin', 'namespace' => 'Admin'], function () {

    //后台index
    Route::match(['get', 'post'], '/', "IndexController@index");

    //异步上传文件
    Route::post('uploadfile', "IndexController@uploadfile");
    //登录退出
    Route::match(['get', 'post'], '/login', "LoginController@index");
    Route::match(['get'], '/logout', "LoginController@logout");

    /*栏目*/
    /*添加子栏目*/
    Route::get('category/addSon/{id}', 'CategoryController@addSon');

    /*添加货品*/
    Route::match(['get', 'post'], 'goodslist/{id}', "GoodsListController@lists");
    /*删除货品*/
    Route::get('goodslistdel/{id}', "GoodsListController@goodslistdel");

    /*资源路由*/
    Route::resources([
        //栏目
        'category' => 'CategoryController',
        //商品
        'goods' => 'GoodsController'
    ]);

    //订单管理 orderlist
    Route::match(['get'], 'orderlist', "OrderController@index");
    Route::match(['get'], 'orderdetails/{id}', "OrderController@orderdetails");
    Route::match(['get'], 'changeorder/{id}/{status}', "OrderController@changeorder");

    //会员管理
    Route::get('user', "UserController@index");

    //管理员管理
    Route::match(['get'], 'admin', "AdminController@index");
    Route::match(['get', 'post'], 'adminadd', "AdminController@adminAdd");
    Route::match(['get'], 'admindel/{id}', "AdminController@admindel");
    //重置密码
    Route::match(['get', 'post'], 'changepassword', "AdminController@changepassword");

    //权限管理

    //权限列表
    Route::match(['get'], 'permiss', "AuthController@permiss");
    //添加
    Route::match(['get', 'post'], 'permissadd/{id}', "AuthController@permissadd");
    //编辑
    Route::match(['get', 'post'], 'permissedit/{id}', "AuthController@permissedit");
    //删除
    Route::match(['post'], 'permissdel/{id}', "AuthController@permissdel");


    //角色列表
    Route::match(['get'], 'role', "AuthController@role");
    //添加
    Route::match(['get', 'post'], 'roleadd', "AuthController@roleadd");
    //编辑
    Route::match(['get', 'post'], 'roleedit/{id}', "AuthController@roleedit");
    //删除
    Route::match(['post'], 'roledel/{id}', "AuthController@roledel");

    //角色 用户 编辑
    Route::match(['get', 'post'], 'userrole/{id}', "AuthController@userrole");


});
